home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 2002 November / SGI Freeware 2002 November - Disc 2.iso / dist / fw_html2ps.idb / usr / freeware / bin / xhtml2ps.z / xhtml2ps
Text File  |  1999-01-26  |  38KB  |  988 lines

  1. #!/usr/bin/wish
  2.  
  3.  
  4. ##############################################################################
  5. #
  6. # X-html2ps - A GUI frontend for html2ps (*), a HTML-to-PostScript converter.
  7. #
  8. # Copyright (C) 1997 Jean-Philippe Argaud.
  9. #
  10. # This program is free software; you can redistribute it and/or
  11. # modify it under the terms of the GNU General Public License
  12. # as published by the Free Software Foundation; either version 2
  13. # of the License, or (at your option) any later version.
  14. #
  15. # This program is distributed in the hope that it will be useful,
  16. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  18. # GNU General Public License for more details.
  19. #
  20. # You should have received a copy of the GNU General Public License
  21. # along with this program; if not, write to the Free Software
  22. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  23. #
  24. ##############################################################################
  25. # (*)  Copyright (C) 1995-1997 Jan Karrman, e-mail: jan@tdb.uu.se.           #
  26. #      (WWW location : http://www.tdb.uu.se/~jan/html2ps.html)               #
  27. # (**) This program was done, for some parts, using Visual Tcl v1.10, a      #
  28. #      great and useful "Application Development Environment For Tcl/Tk"     #
  29. #      (WWW location : http://www.neuron.com/stewart/vtcl/)                  #
  30. ##############################################################################
  31. # xhtml2ps (size : 37819 octets, released : June 26, 1997)                   #
  32. ##############################################################################
  33.  
  34.  
  35. ##############################################################################
  36. # This file contains three parts :
  37. # 1. the file selection box definition
  38. # 2. the configuration and useful commands
  39. # 3. the GUI procedures
  40. #
  41. ##############################################################################
  42. #
  43. ##############################################################################
  44. # 1. FILE SELECTION BOX
  45. ##############################################################################
  46.   #
  47.   # Usage : FS_Box <default filename>
  48.   #         The default filename is optionnal. Output the complete filename
  49.   #         chosen or nothing if Canceled
  50.   #           set file [FS_Box $file]
  51.   #
  52.   ##############################################################################
  53.   #
  54. proc FS_Box {{default ""}} {
  55.   global fsdata filename
  56.   #
  57.   # Initial default values
  58.   # ----------------------
  59.   set fsdata(default)  $default
  60.   set fsdata(filename) [file tail $default]
  61.   set fsdata(dirname)  [pwd]
  62.   array set fsdata {
  63.     filter          *.html
  64.     hidden          0
  65.   }
  66.   #
  67.   # Bindings of default key actions
  68.   # -------------------------------
  69.   bind Entry <ButtonRelease-2> {}
  70.   bind Entry <Control-k>       " %W delete 0 end "
  71.   bind Entry <Left>            " FS_EntryCursor %W -1 "
  72.   bind Entry <Right>           " FS_EntryCursor %W 1 "
  73.   bind Entry <2>               { %W insert insert "[FS_GetXSelect]" }
  74.   bind Listbox <1>             {}
  75.   #
  76.   FS_GUI
  77.   #
  78. }
  79.   #
  80.   ##############################################################################
  81.   #
  82. proc FS_GUI {} {
  83.   global fsdata filename
  84.   #
  85.   set w .fsl
  86.   #
  87.   # Global window definition
  88.   # ------------------------
  89.   catch {destroy $w}
  90.   toplevel    $w -class Toplevel
  91.   wm title    $w "File Selection Box"
  92.   wm iconname $w "File Selection Box"
  93.   wm minsize  $w 1 1
  94.   wm protocol $w WM_DELETE_WINDOW { }
  95.   #
  96.   # Listbox to select the directory and file
  97.   # ----------------------------------------
  98.   frame $w.l -borderwidth 2
  99.   pack [frame $w.l.d -borderwidth 0]\
  100.         -side left -expand 1 -fill both
  101.   pack [label $w.l.d.label -relief flat -borderwidth 2 \
  102.         -text "Directories :" -anchor nw] \
  103.         -side top -expand 1 -fill both
  104.   pack [listbox $w.l.d.dirs -relief sunken -borderwidth 2 \
  105.         -yscrollcommand "$w.l.d.scrolldir set" -setgrid 1] \
  106.         -side left -expand 1 -fill both
  107.   pack [scrollbar $w.l.d.scrolldir -relief sunken \
  108.         -command "$w.l.d.dirs yview" -width 10] \
  109.         -side left -after $w.l.d.dirs -fill y
  110.   #
  111.   pack [frame $w.l.f -borderwidth 0]\
  112.         -side left -expand 1 -fill both
  113.   pack [label $w.l.f.label -relief flat -borderwidth 2 \
  114.         -text "Files :" -anchor nw] \
  115.         -side top -expand 1 -fill both
  116.   pack [listbox $w.l.f.files -relief sunken -borderwidth 2 \
  117.         -yscrollcommand "$w.l.f.scrollfile set" -setgrid 1] \
  118.         -side right -expand 1 -fill both
  119.   pack [scrollbar $w.l.f.scrollfile -relief sunken \
  120.         -command "$w.l.f.files yview" -width 10] \
  121.         -side right -before $w.l.f.files -fill y
  122.   pack $w.l -side top -fill both -expand 1 -padx 3 -pady 5
  123.   #
  124.   # Directory name entry zone definition
  125.   # ------------------------------------
  126.   frame $w.d -borderwidth 2 -relief groove
  127.   pack [label $w.d.dirtext -text "Directory : "] \
  128.         -side left -fill x -padx 1m -pady 2m
  129.   pack [entry $w.d.dirname -width 40 -relief sunken \
  130.         -bd 2 -textvariable fsdata(dirname) ] \
  131.         -side left -fill x -padx 1m -pady 2m -expand 1
  132.   pack $w.d -side top -fill both -padx 5 -pady 5
  133.   #
  134.   # Filters
  135.   # -------
  136.   frame $w.i -borderwidth 2 -relief groove
  137.   pack [checkbutton $w.i.hidden -text "View hidden files" \
  138.         -variable fsdata(hidden) -command FS_ChangeDir] \
  139.         -side left -fill x -padx 1m -pady 2m
  140.   pack [label $w.i.lpatt -text "File filter : "] \
  141.         -side right -fill x -padx 1m -pady 2m
  142.   pack [entry $w.i.filter -width 10  -relief sunken \
  143.         -bd 2 -textvariable fsdata(filter)] \
  144.         -side right -fill x -padx 1m -pady 2m -before $w.i.lpatt
  145.   pack $w.i -side top -fill both -padx 5 -pady 1
  146.   #
  147.   # Buttons
  148.   # -------
  149.   set f $w.butt
  150.   frame $f -borderwidth 2
  151.   pack  $f -side bottom -anchor w -expand 0 -fill x -padx 1m -pady 1m
  152.   #
  153.   pack [button $f.ok  -width 10 -text "OK" \
  154.         -command " FS_GetFile "] \
  155.         -anchor center -expand 0 -fill none -side left -padx 1m
  156.   pack [button $f.can -width 10 -text "Cancel" \
  157.         -command "set filename \"$fsdata(default)\" ; FS_Exit "] \
  158.         -anchor center -expand 0 -fill none -side left -padx 1m
  159.   #
  160.   # Bindings of defaults key actions
  161.   # --------------------------------
  162.   bind $w.d.dirname <Return>          " FS_ChangeDir "
  163.   bind $w.l.d.dirs  <1>               " FS_GetSelection %W @%x,%y "
  164.   bind $w.l.f.files <1>               " FS_GetSelection %W @%x,%y "
  165.   bind $w.l.d.dirs  <Double-Button-1> " FS_GetDir %W @%x,%y "
  166.   bind $w.l.f.files <Double-Button-1> " FS_GetFile "
  167.   bind $w.i.filter <Return>           " FS_ChangeDir "
  168.   #
  169.   # Set default focus
  170.   # -----------------
  171.   set w .fsl
  172.   wm withdraw $w
  173.   update idletasks
  174.   set x [expr [winfo screenwidth $w]/2  - [winfo reqwidth $w]/2  ]
  175.   set y [expr [winfo screenheight $w]/2 - [winfo reqheight $w]/2 ]
  176.   wm geom $w +$x+$y
  177.   wm deiconify $w
  178.   set fsdata(oldFocus) [focus]
  179.   set fsdata(oldGrab)  [grab current $w]
  180.   if {$fsdata(oldGrab) != ""} {
  181.     set fsdata(grabStatus) [grab status $fsdata(oldGrab)]
  182.   }
  183.   grab $w
  184.   focus $w
  185.   #
  186.   FS_ChangeDir
  187.   #
  188.   tkwait variable filename
  189.   return $filename
  190. }
  191.   #
  192.   ##############################################################################
  193.   #
  194. proc FS_EntryCursor {w dir} {
  195.   set x [$w index insert]
  196.   set x [expr $x + $dir]
  197.   $w icursor $x
  198. }
  199.   #
  200.   ##############################################################################
  201.   #
  202. proc FS_GetXSelect { } {
  203.   set s ""   
  204.   catch {set s [selection get STRING]}
  205.   return "$s"
  206. }
  207.   #
  208.   ##############################################################################
  209.   #
  210. proc FS_ChangeDir { } {
  211.   global fsdata
  212.   #
  213.   cd $fsdata(dirname)
  214.   set w .fsl.l
  215.   $w.d.dirs delete 0 end
  216.   $w.f.files delete 0 end
  217.   if {$fsdata(hidden)} {
  218.     if {[catch {set allfiles [glob * .?*]}]} {return}
  219.   } else {
  220.     $w.d.dirs insert end ".."
  221.     if {[catch {set allfiles [glob *]}]} {return}
  222.   }
  223.   foreach i [lsort $allfiles] {
  224.     if { [file isdirectory $i] } {
  225.       $w.d.dirs insert end $i
  226.     } else {
  227.       if {[string match $fsdata(filter) $i]} {$w.f.files insert end $i}
  228.     }
  229.   }
  230. }
  231.   #
  232.   ##############################################################################
  233.   #
  234. proc FS_GetSelection {win pos} {
  235.   global fsdata
  236.   #
  237.   $win selection clear active
  238.   $win selection set [$win index $pos]
  239.   #
  240.   if {[string match $win ".fsl.l.f.files"]} {
  241.     set f [.fsl.l.f.files curselection]
  242.     set fsdata(filename) [.fsl.l.f.files get $f]
  243.   }
  244. }
  245.   #
  246.   ##############################################################################
  247.   #
  248. proc FS_GetDir {win pos} {
  249.   global fsdata
  250.   #
  251.   $win selection clear active
  252.   $win selection set [$win index $pos]
  253.   #
  254.   set f [.fsl.l.d.dirs curselection]
  255.   set d [.fsl.l.d.dirs get $f]
  256.   cd $d
  257.   set fsdata(dirname) [pwd]
  258.   #
  259.   FS_ChangeDir
  260. }
  261.   #
  262.   ##############################################################################
  263.   #
  264. proc FS_GetFile {} {
  265.   global fsdata filename
  266.   #
  267.   set s $fsdata(dirname)
  268.   set l [string length $s]
  269.   if {$l > 0} {set s ${s}/}
  270.   #
  271.   set dirfile "$s$fsdata(filename)"
  272.   if {[file exists $dirfile]} {
  273.     set filename "$s$fsdata(filename)"
  274.     FS_Exit
  275.   } else {
  276.     set filename ""
  277.   }
  278.   #
  279. }
  280.   #
  281.   ##############################################################################
  282.   #
  283. proc FS_Exit {} {
  284.   global fsdata
  285.   #
  286.   catch {focus $fsdata(oldFocus)}
  287.   destroy .fsl
  288.   if {$fsdata(oldGrab) != ""} {
  289.     if {$fsdata(grabStatus) == "global"} {
  290.       grab -global $fsdata(oldGrab)
  291.     } else {
  292.       grab $fsdata(oldGrab)
  293.     }
  294.   }
  295. }
  296. ##############################################################################
  297. # END OF FILE SELECTION BOX
  298. ##############################################################################
  299. #
  300. #
  301. ##############################################################################
  302. # 2. CONFIGURATION AND USEFUL COMMANDS
  303. ##############################################################################
  304.   #
  305.   ##############################################################################
  306.   #
  307. proc UT_Config {} {
  308.   global stusr
  309.   #
  310.   # Default options
  311.   # ---------------
  312.   option add *font            "-adobe-helvetica-bold-r-normal--*-120-*" widgetDefault
  313.   option add *Button.font     "-adobe-helvetica-bold-r-normal--*-120-*" widgetDefault
  314.   option add *Label.font      "-adobe-helvetica-bold-r-normal--*-120-*" widgetDefault
  315.   option add *Entry.font      "-adobe-courier-medium-r-normal--*-120-*" widgetDefault
  316.   option add *Listbox.font    "-adobe-courier-medium-r-normal--*-120-*" widgetDefault
  317.   option add *Menu.tearOff    0
  318.   option add *Menu.background #aeaeae
  319.   #
  320.   bind all <Control-q> { exit }
  321.   bind all <Control-h> { UT_Manual }
  322.   bind all <Control-a> { UT_About }
  323.   #
  324.   # html2ps options
  325.   # ---------------
  326.   array set stusr {
  327.     command     "html2ps"
  328.     checker     "weblint -x Netscape"
  329.     filename    ""
  330.     orientation " "
  331.     colonnes    " "
  332.     numpages    "-n"
  333.     infodbg     " "
  334.     frame       " "
  335.     greyscale   "-g"
  336.     tocexist    "-C"
  337.     tocbegin    "b"
  338.     tocorig     "h"
  339.     textonly    " "
  340.     textcolor   " "
  341.     linkunder   " "
  342.     scaledoc    "1.0"
  343.     scaleimg    "1.0"
  344.     scalemat    "1.0"
  345.     imgorig     " "
  346.   }
  347. }
  348. UT_Config
  349.   #
  350.   ##############################################################################
  351.   # Show the About comment
  352.   #-----------------------------------------------------------------------------
  353.   #
  354. proc UT_About {} {
  355.   #
  356.   set w .msgwin
  357.   if [catch {toplevel $w}] {
  358.     raise $w
  359.   } else {
  360.     wm title    $w "About"
  361.     wm iconname $w "About"
  362.     set titlefont "-adobe-times-bold-i-normal--*-240-*"
  363.     set textfont  "-adobe-helvetica-medium-r-normal--*-120-*"
  364.     pack [label $w.msg1 -text "X-html2ps 1.0" -font $titlefont]\
  365.          -side top -padx 1m -pady 1m -ipadx 3m
  366.     pack [label $w.msg2 -font $textfont -text \
  367.          "Generic Tk/Tcl interface for html2ps 1.0b,\n\
  368.           a HTML to Postscript translator\n\
  369.           (from Jan Karrman, e-mail: jan@tdb.uu.se)\n\n\
  370.           Jean-Philippe ARGAUD - June 1997"]\
  371.          -side top -padx 1m -pady 1m -ipadx 3m
  372.     pack [button  $w.ok -text OK -width 10 -command { destroy .msgwin }]\
  373.          -side top -padx 1m -pady 1m -ipadx 3m
  374.   }
  375. }
  376.   #
  377.   ##############################################################################
  378.   #
  379. proc UT_Manual {} {
  380.   #
  381.   set running [open "| man html2ps |& cat" r+]
  382.   set Output ""
  383.   flush $running
  384.   while {[gets $running msg] >= 0} {
  385.     regsub -all "_" $msg "" msg
  386.     regsub -all "." $msg "" msg
  387.     append Output "  $msg\n"
  388.   }
  389.   catch { close $running }
  390.   #
  391.   UT_ViewMsg $Output
  392. }
  393.   #
  394.   ##############################################################################
  395.   #
  396. proc UT_Checking {} {
  397.   global stusr
  398.   #
  399.   if (![string compare $stusr(filename) ""]) {
  400.     return
  401.   }
  402.   set running [open "| $stusr(checker) $stusr(filename) |& cat" r+]
  403.   set Output ""
  404.   flush $running
  405.   while {[gets $running msg] >= 0} {
  406.     append Output "  $msg\n"
  407.   }
  408.   catch { close $running }
  409.   #
  410.   set l [string length $Output]
  411.   if {$l <= 0} {set Output "Checking done, HTML file OK !"}
  412.   UT_ViewMsg $Output
  413. }
  414.   #
  415.   ##############################################################################
  416.   #
  417. proc UT_Convert {} {
  418.   global stusr
  419.   #
  420.   if (![string compare $stusr(filename) ""]) {
  421.     return
  422.   }
  423.   #
  424.   set fichier [file tail $stusr(filename)]
  425.   set fichier [file rootname $fichier]
  426.   #
  427.   set stusr(convert) \
  428.     "$stusr(command)   $stusr(orientation) $stusr(colonnes)  $stusr(numpages) \
  429.      $stusr(infodbg)   $stusr(frame)       $stusr(greyscale) $stusr(textonly) \
  430.      $stusr(textonly)  $stusr(imgorig)     $stusr(textcolor) $stusr(linkunder)\
  431.      -s $stusr(scaledoc) -i $stusr(scaleimg) -m $stusr(scalemat)"
  432.   if (![string compare $stusr(tocexist) "-C"]) {
  433.     append stusr(convert) " $stusr(tocexist) $stusr(tocbegin)$stusr(tocorig)"
  434.   }
  435.   append stusr(convert) " -o $fichier.ps $stusr(filename)"
  436.   #
  437.   set running [open "| $stusr(convert) |& cat" r+]
  438.   set Output ""
  439.   flush $running
  440.   while {[gets $running msg] >= 0} {
  441.     append Output "  $msg\n"
  442.   }
  443.   catch { close $running }
  444.   #
  445.   if (![string compare $Output "  \n"]) {
  446.     UT_ViewMsg $Output
  447.   }
  448.   #
  449. }
  450.   #
  451.   ##############################################################################
  452.   #
  453. proc UT_ViewMsg { message } {
  454.   #
  455.   set width 10
  456.   set w .msgwin
  457.   if [catch {toplevel $w}] {
  458.     raise $w
  459.   } else {
  460.     wm title    $w "MiniBrowser"
  461.     wm iconname $w "MiniBrowser"
  462.     wm minsize  $w 1 1
  463.     wm protocol $w WM_DELETE_WINDOW { }
  464.     #
  465.     frame $w.frame -borderwidth 2
  466.     pack $w.frame -side top -fill both -expand 1
  467.     #
  468.     # Text zone and scrollbar definition
  469.     # ----------------------------------
  470.     frame $w.frame.t -borderwidth 2 -relief groove
  471.     pack [text $w.frame.t.text -width 80 -height 30 -relief flat \
  472.           -font fixed -wrap word -padx 5 -pady 5 \
  473.           -yscrollcommand "$w.frame.t.scroll set" ] \
  474.           -side left -fill both -expand 1
  475.     pack [scrollbar $w.frame.t.scroll -relief sunken -width 3m \
  476.           -command "$w.frame.t.text yview" ] \
  477.           -side left -fill y
  478.     pack $w.frame.t -side top -fill both -expand 1 -padx 5 -pady 5
  479.     #
  480.     # Button definition
  481.     # -----------------
  482.     frame $w.frame.b -borderwidth 2
  483.     pack [button $w.frame.b.close -width $width -text Close \
  484.           -command "destroy $w" ] \
  485.           -side top  -fill x -expand 1
  486.     pack $w.frame.b -side bottom -fill both -padx 5 -pady 5
  487.   }
  488.   #
  489.   # Editing properties
  490.   # ------------------
  491.   set w $w.frame.t.text
  492.   $w configure -state normal 
  493.   $w delete 1.0 end
  494.   # Get the file to see
  495.   $w insert 1.0 $message
  496.   $w configure -state disabled 
  497.   # Move the view to file beginning
  498.   $w yview -pickplace 1.0
  499. }
  500. ##############################################################################
  501. # END OF CONFIGURATION AND USEFUL COMMANDS
  502. ##############################################################################
  503. #
  504. #
  505. ##############################################################################
  506. # 3. GUI PROCEDURES
  507. ##############################################################################
  508.   # VTCL generated code, and modified
  509.   #
  510.   ##############################################################################
  511.   #
  512. proc Window {args} {
  513.     global vTcl
  514.     set cmd [lindex $args 0]
  515.     set name [lindex $args 1]
  516.     set newname [lindex $args 2]
  517.     set rest [lrange $args 3 end]
  518.     if {$name == "" || $cmd == ""} {return}
  519.     if {$newname == ""} {
  520.         set newname $name
  521.     }
  522.     set exists [winfo exists $newname]
  523.     switch $cmd {
  524.         show {
  525.             if {$exists == "1" && $name != "."} {wm deiconify $name; return}
  526.             if {[info procs vTclWindow(pre)$name] != ""} {
  527.                 eval "vTclWindow(pre)$name $newname $rest"
  528.             }
  529.             if {[info procs vTclWindow$name] != ""} {
  530.                 eval "vTclWindow$name $newname $rest"
  531.             }
  532.             if {[info procs vTclWindow(post)$name] != ""} {
  533.                 eval "vTclWindow(post)$name $newname $rest"
  534.             }
  535.         }
  536.         hide    { if $exists {wm withdraw $newname; return} }
  537.         iconify { if $exists {wm iconify $newname; return} }
  538.         destroy { if $exists {destroy $newname; return} }
  539.     }
  540. }
  541.   #
  542.   ##############################################################################
  543.   #
  544. proc vTclWindow. {base} {
  545.     if {$base == ""} {
  546.         set base .
  547.     }
  548.     ###################
  549.     # CREATING WIDGETS
  550.     ###################
  551.     wm focusmodel $base passive
  552.     wm minsize $base 1 1
  553.     wm overrideredirect $base 0
  554.     wm resizable $base 1 1
  555.     wm withdraw $base
  556.     wm title $base "vt.tcl"
  557. }
  558.   #
  559.   ##############################################################################
  560.   #
  561. proc vTclWindow.main {base} {
  562.     if {$base == ""} {
  563.         set base .main
  564.     }
  565.     if {[winfo exists $base]} {
  566.         wm deiconify $base; return
  567.     }
  568.     ###################
  569.     # CREATING WIDGETS
  570.     ###################
  571.     toplevel $base -class Toplevel
  572.     wm focusmodel $base passive
  573.     wm minsize $base 1 1
  574.     wm overrideredirect $base 0
  575.     wm resizable $base 1 1
  576.     wm deiconify $base
  577.     wm title $base "X-html2ps"
  578.     frame $base.fra22 \
  579.         -borderwidth 2 -height 33 -width 125 
  580.     #
  581.     # Top buttons and menu
  582.     # --------------------
  583.     button $base.fra22.but24 \
  584.         -cursor hand2 -padx 11 -pady 4 \
  585.         -command { UT_Convert } -text {Convert to Postscript} 
  586.     button $base.fra22.but25 \
  587.         -cursor hand2 -padx 11 -pady 4 \
  588.         -command { UT_Checking } -text { HTML Check } 
  589.     button $base.fra22.but26 \
  590.         -cursor hand2 -padx 11 -pady 4 \
  591.         -command { exit } -text { Exit } 
  592.     label $base.fra22.lab26 \
  593.         -borderwidth 1 -font -Adobe-Times-Medium-I-Normal--*-240-*-*-*-*-*-* \
  594.         -text {X-html2ps 1.0} 
  595.     menubutton $base.fra22.men28 \
  596.         -cursor hand2 -padx 11 -pady 4 \
  597.         -menu .main.fra22.men28.m -text { Help } -relief raised
  598.     menu $base.fra22.men28.m
  599.     $base.fra22.men28.m add command \
  600.         -accelerator Ctrl+A -command { UT_About } -label { About }
  601.     $base.fra22.men28.m add command \
  602.         -accelerator Ctrl+H -command { UT_Manual } -label { Man Page   }
  603.     #
  604.     # File entry
  605.     # ----------
  606.     frame $base.fra23 \
  607.         -borderwidth 2 -height 42 -relief groove -width 125 
  608.     button $base.fra23.02 \
  609.         -cursor hand2 -padx 11 -pady 4 \
  610.         -command { set stusr(filename) [ FS_Box $stusr(filename) ] } \
  611.         -text {File . . . } 
  612.     entry $base.fra23.ent27 \
  613.         -textvariable stusr(filename) 
  614.     #
  615.     # Options frames
  616.     # --------------
  617.     frame $base.fra17 \
  618.         -borderwidth 2 -height 353 -relief groove -width 117 
  619.     frame $base.fra17.01 \
  620.         -borderwidth 2 -height 75 -relief groove -width 125 
  621.     label $base.fra17.01.02 \
  622.         -borderwidth 1 -font -adobe-helvetica-bold-r-normal--*-120-* \
  623.         -text {Appearance :} 
  624.     frame $base.fra17.01.03 \
  625.         -borderwidth 2 -height 75 -width 125 
  626.     frame $base.fra17.01.03.04 \
  627.         -height 75 -width 125 
  628.     label $base.fra17.01.03.04.05 \
  629.         -borderwidth 4 -font -adobe-helvetica-medium-r-normal--*-120-* \
  630.         -pady 4 -text {Aspect :} 
  631.     label $base.fra17.01.03.04.06 \
  632.         -borderwidth 4 -font -adobe-helvetica-medium-r-normal--*-120-* \
  633.         -pady 4 -text {Number of columns :} 
  634.     label $base.fra17.01.03.04.07 \
  635.         -borderwidth 4 -font -adobe-helvetica-medium-r-normal--*-120-* \
  636.         -pady 4 -text {Page numbers :} 
  637.     label $base.fra17.01.03.04.lab31 \
  638.         -borderwidth 4 -font -adobe-helvetica-medium-r-normal--*-120-* \
  639.         -pady 4 -text {Images in greyscale :} 
  640.     label $base.fra17.01.03.04.lab32 \
  641.         -borderwidth 4 -font -adobe-helvetica-medium-r-normal--*-120-* \
  642.         -pady 4 -text {Border frame :} 
  643.     label $base.fra17.01.03.04.lab33 \
  644.         -borderwidth 4 -font -adobe-helvetica-medium-r-normal--*-120-* \
  645.         -pady 4 -text {Text only :} 
  646.     label $base.fra17.01.03.04.lab34 \
  647.         -borderwidth 4 -font -adobe-helvetica-medium-r-normal--*-120-* \
  648.         -pady 4 -text {Text in colors :} 
  649.     label $base.fra17.01.03.04.lab35 \
  650.         -borderwidth 4 -font -adobe-helvetica-medium-r-normal--*-120-* \
  651.         -pady 4 -text {Links underlined :} 
  652.     frame $base.fra17.01.03.011 \
  653.         -height 75 -width 125 
  654.     frame $base.fra17.01.03.011.012 \
  655.         -height 75 -width 125 
  656.     radiobutton $base.fra17.01.03.011.012.013 \
  657.         -font -adobe-helvetica-medium-r-normal--*-120-* -pady 4 -text Portait \
  658.         -value { } -variable stusr(orientation) 
  659.     radiobutton $base.fra17.01.03.011.012.014 \
  660.         -font -adobe-helvetica-medium-r-normal--*-120-* -pady 4 -text Landscape \
  661.         -value -L -variable stusr(orientation) 
  662.     frame $base.fra17.01.03.011.015 \
  663.         -height 75 -width 125 
  664.     radiobutton $base.fra17.01.03.011.015.016 \
  665.         -font -adobe-helvetica-medium-r-normal--*-120-* -pady 4 -text 1 \
  666.         -value { } -variable stusr(colonnes) 
  667.     radiobutton $base.fra17.01.03.011.015.017 \
  668.         -font -adobe-helvetica-medium-r-normal--*-120-* -pady 4 -text 2 \
  669.         -value -2 -variable stusr(colonnes) 
  670.     frame $base.fra17.01.03.011.018 \
  671.         -height 75 -width 125 
  672.     radiobutton $base.fra17.01.03.011.018.019 \
  673.         -font -adobe-helvetica-medium-r-normal--*-120-* -pady 4 -text Yes \
  674.         -value -n -variable stusr(numpages) 
  675.     radiobutton $base.fra17.01.03.011.018.020 \
  676.         -command {set stusr(tocexist) " "} \
  677.         -font -adobe-helvetica-medium-r-normal--*-120-* -pady 4 -text No \
  678.         -value { } -variable stusr(numpages) 
  679.     frame $base.fra17.01.03.011.024 \
  680.         -height 75 -width 125 
  681.     radiobutton $base.fra17.01.03.011.024.025 \
  682.         -font -adobe-helvetica-medium-r-normal--*-120-* -pady 4 -text Yes \
  683.         -value -g -variable stusr(greyscale) 
  684.     radiobutton $base.fra17.01.03.011.024.026 \
  685.         -font -adobe-helvetica-medium-r-normal--*-120-* -pady 4 -text No \
  686.         -value { } -variable stusr(greyscale) 
  687.     frame $base.fra17.01.03.011.fra36 \
  688.         -height 75 -width 125 
  689.     radiobutton $base.fra17.01.03.011.fra36.01 \
  690.         -font -adobe-helvetica-medium-r-normal--*-120-* -pady 4 -text Yes \
  691.         -value -F -variable stusr(frame) 
  692.     radiobutton $base.fra17.01.03.011.fra36.02 \
  693.         -font -adobe-helvetica-medium-r-normal--*-120-* -pady 4 -text No \
  694.         -value { } -variable stusr(frame) 
  695.     frame $base.fra17.01.03.011.fra37 \
  696.         -height 75 -width 125 
  697.     radiobutton $base.fra17.01.03.011.fra37.01 \
  698.         -font -adobe-helvetica-medium-r-normal--*-120-* -pady 4 -text Yes \
  699.         -value -T -variable stusr(textonly) 
  700.     radiobutton $base.fra17.01.03.011.fra37.02 \
  701.         -font -adobe-helvetica-medium-r-normal--*-120-* -pady 4 -text No \
  702.         -value { } -variable stusr(textonly) 
  703.     frame $base.fra17.01.03.011.fra38 \
  704.         -height 75 -width 125 
  705.     radiobutton $base.fra17.01.03.011.fra38.01 \
  706.         -font -adobe-helvetica-medium-r-normal--*-120-* -pady 4 -text Yes \
  707.         -value -U -variable stusr(textcolor) 
  708.     radiobutton $base.fra17.01.03.011.fra38.02 \
  709.         -font -adobe-helvetica-medium-r-normal--*-120-* -pady 4 -text No \
  710.         -value { } -variable stusr(textcolor) 
  711.     frame $base.fra17.01.03.011.fra39 \
  712.         -height 75 -width 125 
  713.     radiobutton $base.fra17.01.03.011.fra39.01 \
  714.         -font -adobe-helvetica-medium-r-normal--*-120-* -pady 4 -text Yes \
  715.         -value -u -variable stusr(linkunder) 
  716.     radiobutton $base.fra17.01.03.011.fra39.02 \
  717.         -font -adobe-helvetica-medium-r-normal--*-120-* -pady 4 -text No \
  718.         -value { } -variable stusr(linkunder) 
  719.     frame $base.fra17.036 \
  720.         -borderwidth 2 -height 75 -relief groove -width 125 
  721.     label $base.fra17.036.037 \
  722.         -borderwidth 1 -font -adobe-helvetica-bold-r-normal--*-120-* \
  723.         -foreground #000000 -text {Table of contents :} 
  724.     frame $base.fra17.036.038 \
  725.         -borderwidth 2 -height 75 -width 125 
  726.     radiobutton $base.fra17.036.038.039 \
  727.         -command {set stusr(numpages) "-n"} \
  728.         -font -adobe-helvetica-medium-r-normal--*-120-* -text Yes -value -C \
  729.         -variable stusr(tocexist) 
  730.     radiobutton $base.fra17.036.038.040 \
  731.         -font -adobe-helvetica-medium-r-normal--*-120-* -text No -value { } \
  732.         -variable stusr(tocexist) 
  733.     label $base.fra17.036.041 \
  734.         -borderwidth 1 -font -adobe-helvetica-medium-r-normal--*-120-* \
  735.         -text {... included at the :} 
  736.     frame $base.fra17.036.042 \
  737.         -borderwidth 2 -height 75 -width 125 
  738.     radiobutton $base.fra17.036.042.043 \
  739.         -font -adobe-helvetica-medium-r-normal--*-120-* -text {beginning} \
  740.         -value b -variable stusr(tocbegin) 
  741.     radiobutton $base.fra17.036.042.044 \
  742.         -font -adobe-helvetica-medium-r-normal--*-120-* -text {end} \
  743.         -value { } -variable stusr(tocbegin) 
  744.     label $base.fra17.036.045 \
  745.         -borderwidth 1 -font -adobe-helvetica-medium-r-normal--*-120-* \
  746.         -text {... and built from :} 
  747.     frame $base.fra17.036.046 \
  748.         -borderwidth 2 -height 75 -width 125 
  749.     radiobutton $base.fra17.036.046.047 \
  750.         -font -adobe-helvetica-medium-r-normal--*-120-* \
  751.         -text {HTML elements H#} -value h -variable stusr(tocorig) 
  752.     radiobutton $base.fra17.036.046.048 \
  753.         -font -adobe-helvetica-medium-r-normal--*-120-* \
  754.         -text {links} -value f -variable stusr(tocorig) 
  755.     radiobutton $base.fra17.036.046.049 \
  756.         -font -adobe-helvetica-medium-r-normal--*-120-* \
  757.         -text {links with attribute} -value t -variable stusr(tocorig) 
  758.     frame $base.fra17.fra40 \
  759.         -borderwidth 2 -height 75 -relief groove -width 125 
  760.     frame $base.fra17.fra40.fra54 \
  761.         -borderwidth 2 -height 75 -width 177 
  762.     label $base.fra17.fra40.fra54.lab55 \
  763.         -borderwidth 1 -font -adobe-helvetica-bold-r-normal--*-120-* \
  764.         -text {Scale factors for :} 
  765.     frame $base.fra17.fra40.fra54.fra56 \
  766.         -borderwidth 2 -height 75 -width 125 
  767.     label $base.fra17.fra40.fra54.fra56.01 \
  768.         -borderwidth 4 -font -adobe-helvetica-medium-r-normal--*-120-* \
  769.         -pady 4 -text {the document :} 
  770.     label $base.fra17.fra40.fra54.fra56.02 \
  771.         -borderwidth 4 -font -adobe-helvetica-medium-r-normal--*-120-* \
  772.         -pady 4 -text {the images :} 
  773.     label $base.fra17.fra40.fra54.fra56.03 \
  774.         -borderwidth 4 -font -adobe-helvetica-medium-r-normal--*-120-* \
  775.         -pady 4 -text {the formulas :} 
  776.     frame $base.fra17.fra40.fra54.fra57 \
  777.         -borderwidth 2 -height 75 -width 125 
  778.     entry $base.fra17.fra40.fra54.fra57.01 \
  779.         -font -adobe-courier-medium-r-normal--*-120-* \
  780.         -textvariable stusr(scaledoc) -width 5 
  781.     entry $base.fra17.fra40.fra54.fra57.02 \
  782.         -font -adobe-courier-medium-r-normal--*-120-* \
  783.         -textvariable stusr(scaleimg) -width 5 
  784.     entry $base.fra17.fra40.fra54.fra57.03 \
  785.         -font -adobe-courier-medium-r-normal--*-120-* \
  786.         -textvariable stusr(scalemat) -width 5 
  787.     frame $base.fra17.fra40.fra58 \
  788.         -borderwidth 2 -height 75 -width 125 
  789.     label $base.fra17.fra40.fra58.lab59 \
  790.         -borderwidth 1 -font -adobe-helvetica-bold-r-normal--*-120-* \
  791.         -text {Advanced options :} 
  792.     checkbutton $base.fra17.fra40.fra58.che60 \
  793.         -font -adobe-helvetica-medium-r-normal--*-120-* -offvalue { } \
  794.         -onvalue -d -text {Debug infos} -variable stusr(infodbg) 
  795.     checkbutton $base.fra17.fra40.fra58.che61 \
  796.         -font -adobe-helvetica-medium-r-normal--*-120-* -text check \
  797.         -onvalue -O -text {Original postscript images} -variable stusr(imgorig) 
  798.     ###################
  799.     # SETTING GEOMETRY
  800.     ###################
  801.     pack $base.fra22 \
  802.         -in .main -anchor n -expand 0 -fill x -padx 4 -pady 4 -side top 
  803.     pack $base.fra22.men28 \
  804.         -in .main.fra22 -anchor center -expand 0 -fill none -side right 
  805.     pack $base.fra22.but24 \
  806.         -in .main.fra22 -anchor center -expand 0 -fill none -side left 
  807.     pack $base.fra22.but25 \
  808.         -in .main.fra22 -anchor center -expand 0 -fill none -side left 
  809.     pack $base.fra22.but26 \
  810.         -in .main.fra22 -anchor center -expand 0 -fill none -side left 
  811.     pack $base.fra22.lab26 \
  812.         -in .main.fra22 -anchor center -expand 0 -fill none -side top 
  813.     pack $base.fra23 \
  814.         -in .main -anchor n -expand 0 -fill x -padx 4 -pady 4 -side top 
  815.     pack $base.fra23.02 \
  816.         -in .main.fra23 -anchor center -expand 0 -fill none -side left 
  817.     pack $base.fra23.ent27 \
  818.         -in .main.fra23 -anchor center -expand 1 -fill x -side left 
  819.     pack $base.fra17 \
  820.         -in .main -anchor nw -expand 0 -fill none -padx 4 -pady 4 -side top 
  821.     pack $base.fra17.01 \
  822.         -in .main.fra17 -anchor center -expand 0 -fill y -side left 
  823.     pack $base.fra17.01.02 \
  824.         -in .main.fra17.01 -anchor nw -expand 0 -fill none -side top 
  825.     pack $base.fra17.01.03 \
  826.         -in .main.fra17.01 -anchor center -expand 0 -fill none -side top 
  827.     pack $base.fra17.01.03.04 \
  828.         -in .main.fra17.01.03 -anchor nw -expand 0 -fill none -side left 
  829.     pack $base.fra17.01.03.04.05 \
  830.         -in .main.fra17.01.03.04 -anchor nw -expand 0 -fill none -side top 
  831.     pack $base.fra17.01.03.04.06 \
  832.         -in .main.fra17.01.03.04 -anchor nw -expand 0 -fill none -side top 
  833.     pack $base.fra17.01.03.04.07 \
  834.         -in .main.fra17.01.03.04 -anchor nw -expand 0 -fill none -side top 
  835.     pack $base.fra17.01.03.04.lab31 \
  836.         -in .main.fra17.01.03.04 -anchor nw -expand 0 -fill none -side top 
  837.     pack $base.fra17.01.03.04.lab32 \
  838.         -in .main.fra17.01.03.04 -anchor nw -expand 0 -fill none -side top 
  839.     pack $base.fra17.01.03.04.lab33 \
  840.         -in .main.fra17.01.03.04 -anchor nw -expand 0 -fill none -side top 
  841.     pack $base.fra17.01.03.04.lab34 \
  842.         -in .main.fra17.01.03.04 -anchor nw -expand 0 -fill none -side top 
  843.     pack $base.fra17.01.03.04.lab35 \
  844.         -in .main.fra17.01.03.04 -anchor nw -expand 0 -fill none -side top 
  845.     pack $base.fra17.01.03.011 \
  846.         -in .main.fra17.01.03 -anchor center -expand 0 -fill none -side top 
  847.     pack $base.fra17.01.03.011.012 \
  848.         -in .main.fra17.01.03.011 -anchor nw -expand 0 -fill none -side top 
  849.     pack $base.fra17.01.03.011.012.013 \
  850.         -in .main.fra17.01.03.011.012 -anchor center -expand 0 -fill none \
  851.         -side left 
  852.     pack $base.fra17.01.03.011.012.014 \
  853.         -in .main.fra17.01.03.011.012 -anchor center -expand 0 -fill none \
  854.         -side top 
  855.     pack $base.fra17.01.03.011.015 \
  856.         -in .main.fra17.01.03.011 -anchor nw -expand 0 -fill none -side top 
  857.     pack $base.fra17.01.03.011.015.016 \
  858.         -in .main.fra17.01.03.011.015 -anchor center -expand 0 -fill none \
  859.         -side left 
  860.     pack $base.fra17.01.03.011.015.017 \
  861.         -in .main.fra17.01.03.011.015 -anchor center -expand 0 -fill none \
  862.         -side top 
  863.     pack $base.fra17.01.03.011.018 \
  864.         -in .main.fra17.01.03.011 -anchor nw -expand 0 -fill none -side top 
  865.     pack $base.fra17.01.03.011.018.019 \
  866.         -in .main.fra17.01.03.011.018 -anchor center -expand 0 -fill none \
  867.         -side left 
  868.     pack $base.fra17.01.03.011.018.020 \
  869.         -in .main.fra17.01.03.011.018 -anchor center -expand 0 -fill none \
  870.         -side top 
  871.     pack $base.fra17.01.03.011.024 \
  872.         -in .main.fra17.01.03.011 -anchor nw -expand 0 -fill none -side top 
  873.     pack $base.fra17.01.03.011.024.025 \
  874.         -in .main.fra17.01.03.011.024 -anchor center -expand 0 -fill none \
  875.         -side left 
  876.     pack $base.fra17.01.03.011.024.026 \
  877.         -in .main.fra17.01.03.011.024 -anchor center -expand 0 -fill none \
  878.         -side top 
  879.     pack $base.fra17.01.03.011.fra36 \
  880.         -in .main.fra17.01.03.011 -anchor nw -expand 0 -fill none -side top 
  881.     pack $base.fra17.01.03.011.fra36.01 \
  882.         -in .main.fra17.01.03.011.fra36 -anchor center -expand 0 -fill none \
  883.         -side left 
  884.     pack $base.fra17.01.03.011.fra36.02 \
  885.         -in .main.fra17.01.03.011.fra36 -anchor center -expand 0 -fill none \
  886.         -side top 
  887.     pack $base.fra17.01.03.011.fra37 \
  888.         -in .main.fra17.01.03.011 -anchor nw -expand 0 -fill none -side top 
  889.     pack $base.fra17.01.03.011.fra37.01 \
  890.         -in .main.fra17.01.03.011.fra37 -anchor center -expand 0 -fill none \
  891.         -side left 
  892.     pack $base.fra17.01.03.011.fra37.02 \
  893.         -in .main.fra17.01.03.011.fra37 -anchor center -expand 0 -fill none \
  894.         -side top 
  895.     pack $base.fra17.01.03.011.fra38 \
  896.         -in .main.fra17.01.03.011 -anchor nw -expand 0 -fill none -side top 
  897.     pack $base.fra17.01.03.011.fra38.01 \
  898.         -in .main.fra17.01.03.011.fra38 -anchor center -expand 0 -fill none \
  899.         -side left 
  900.     pack $base.fra17.01.03.011.fra38.02 \
  901.         -in .main.fra17.01.03.011.fra38 -anchor center -expand 0 -fill none \
  902.         -side top 
  903.     pack $base.fra17.01.03.011.fra39 \
  904.         -in .main.fra17.01.03.011 -anchor nw -expand 0 -fill none -side top 
  905.     pack $base.fra17.01.03.011.fra39.01 \
  906.         -in .main.fra17.01.03.011.fra39 -anchor center -expand 0 -fill none \
  907.         -side left 
  908.     pack $base.fra17.01.03.011.fra39.02 \
  909.         -in .main.fra17.01.03.011.fra39 -anchor center -expand 0 -fill none \
  910.         -side top 
  911.     pack $base.fra17.036 \
  912.         -in .main.fra17 -anchor center -expand 0 -fill y -side left 
  913.     pack $base.fra17.036.037 \
  914.         -in .main.fra17.036 -anchor nw -expand 0 -fill none -side top 
  915.     pack $base.fra17.036.038 \
  916.         -in .main.fra17.036 -anchor nw -expand 0 -fill none -side top 
  917.     pack $base.fra17.036.038.039 \
  918.         -in .main.fra17.036.038 -anchor center -expand 0 -fill none \
  919.         -side left 
  920.     pack $base.fra17.036.038.040 \
  921.         -in .main.fra17.036.038 -anchor center -expand 0 -fill none -side top 
  922.     pack $base.fra17.036.041 \
  923.         -in .main.fra17.036 -anchor nw -expand 0 -fill none -side top 
  924.     pack $base.fra17.036.042 \
  925.         -in .main.fra17.036 -anchor nw -expand 0 -fill none -side top 
  926.     pack $base.fra17.036.042.043 \
  927.         -in .main.fra17.036.042 -anchor center -expand 0 -fill none \
  928.         -side left 
  929.     pack $base.fra17.036.042.044 \
  930.         -in .main.fra17.036.042 -anchor center -expand 0 -fill none -side top 
  931.     pack $base.fra17.036.045 \
  932.         -in .main.fra17.036 -anchor nw -expand 0 -fill none -side top 
  933.     pack $base.fra17.036.046 \
  934.         -in .main.fra17.036 -anchor nw -expand 0 -fill none -side top 
  935.     pack $base.fra17.036.046.047 \
  936.         -in .main.fra17.036.046 -anchor nw -expand 0 -fill none -side top 
  937.     pack $base.fra17.036.046.048 \
  938.         -in .main.fra17.036.046 -anchor nw -expand 0 -fill none -side top 
  939.     pack $base.fra17.036.046.049 \
  940.         -in .main.fra17.036.046 -anchor nw -expand 0 -fill none -side top 
  941.     pack $base.fra17.fra40 \
  942.         -in .main.fra17 -anchor center -expand 0 -fill y -side left 
  943.     pack $base.fra17.fra40.fra54 \
  944.         -in .main.fra17.fra40 -anchor nw -expand 0 -fill x -side top 
  945.     pack $base.fra17.fra40.fra54.lab55 \
  946.         -in .main.fra17.fra40.fra54 -anchor nw -expand 0 -fill none -side top 
  947.     pack $base.fra17.fra40.fra54.fra56 \
  948.         -in .main.fra17.fra40.fra54 -anchor nw -expand 0 -fill none \
  949.         -side left 
  950.     pack $base.fra17.fra40.fra54.fra56.01 \
  951.         -in .main.fra17.fra40.fra54.fra56 -anchor nw -expand 0 -fill none \
  952.         -side top 
  953.     pack $base.fra17.fra40.fra54.fra56.02 \
  954.         -in .main.fra17.fra40.fra54.fra56 -anchor nw -expand 0 -fill none \
  955.         -side top 
  956.     pack $base.fra17.fra40.fra54.fra56.03 \
  957.         -in .main.fra17.fra40.fra54.fra56 -anchor nw -expand 0 -fill none \
  958.         -side top 
  959.     pack $base.fra17.fra40.fra54.fra57 \
  960.         -in .main.fra17.fra40.fra54 -anchor center -expand 0 -fill none \
  961.         -side top 
  962.     pack $base.fra17.fra40.fra54.fra57.01 \
  963.         -in .main.fra17.fra40.fra54.fra57 -anchor center -expand 0 -fill none \
  964.         -pady 4 -side top 
  965.     pack $base.fra17.fra40.fra54.fra57.02 \
  966.         -in .main.fra17.fra40.fra54.fra57 -anchor center -expand 0 -fill none \
  967.         -pady 4 -side top 
  968.     pack $base.fra17.fra40.fra54.fra57.03 \
  969.         -in .main.fra17.fra40.fra54.fra57 -anchor center -expand 0 -fill none \
  970.         -pady 4 -side top 
  971.     pack $base.fra17.fra40.fra58 \
  972.         -in .main.fra17.fra40 -anchor nw -expand 0 -fill x -side bottom 
  973.     pack $base.fra17.fra40.fra58.lab59 \
  974.         -in .main.fra17.fra40.fra58 -anchor center -expand 0 -fill none \
  975.         -side top 
  976.     pack $base.fra17.fra40.fra58.che60 \
  977.         -in .main.fra17.fra40.fra58 -anchor nw -expand 0 -fill none -side top 
  978.     pack $base.fra17.fra40.fra58.che61 \
  979.         -in .main.fra17.fra40.fra58 -anchor nw -expand 0 -fill none -side top 
  980. }
  981. ##############################################################################
  982. # END OF GUI PROCEDURES
  983. ##############################################################################
  984.  
  985.  
  986. Window show .
  987. Window show .main
  988.